<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;

class CreateGoodTypesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('good_types', function (Blueprint $table) {
            $table->id();
            $table->integer('store_id')->unsigned()->default(0)->comment('店铺id');
            $table->string('title', 100)->default('')->comment('类别名称');
            $table->string('mark', 100)->default('')->comment('其他名称，可省略');
            $table->integer('sort')->unsigned()->default(0)->comment('排序 , 越大越优先');
            $table->tinyInteger('status')->default(0)->comment('类别状态，1可用，0不可用');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE `good_types` comment '商品分类表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('good_types');
    }
}
